
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

class Base():
    def __init__(self,driver):
        self.driver=driver

    def find_element(self,loc):
        try:
            WebDriverWait(self.driver,10).until(EC.presence_of_element_located(loc))
            return self.driver.find_element(*loc)
        except Exception as e:
            print(e)

    def click(self,loc):
        self.find_element(loc).click()

    def send_keys(self,loc,txt):
        self.find_element(loc).send_keys(txt)

